home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++,
- Subject: Re: Question on template-probs
- Date: 29 Mar 1996 02:18:14 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4jfh96$acq@news1.h1.usa.pipeline.com>
- References: <4jeo7o$q00@sunsystem5.informatik.tu-muenchen.de>
- NNTP-Posting-Host: 38.8.120.16
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 28, 1996 19:10:48 in article <Question on template-probs>,
- 'meisenec@informatik.tu-muenchen.de (Robert Meisenecker)' wrote:
-
-
- >
- >Hi,
- >
- >im an relatively unexperienced C++ programmer, which is the reason for
- this
- >simple question (I bet it's simple for an more experienced programmer): i
-
- >played
- >around with templates and was confronted with the following problem:
- >
- >If I use the template by creating an object of a simple type like int, the
-
- >linker
- >states that all of the member functions of the template are unknown. This
-
- >occurs
- >only when the member functions are NOT coded inline. If the member
- functions
- >are
- >specified inline, then there is no problem with the linker. (Inline means
- here
- >that the problem even occurs when the member functions are not specified
- as
- >part of the class declaration, but in a source file with the leading
- keyword
- >"inline")
- >
- >My question is: how to avoid those linker problems without declaring all
- >member functions as part of the class (becomes a bit confusing when the
- member
- >fuctions are a bit longer...)
- >
- >At first (as an experienced C-Programmer) I thougt of declaring
- Prototypes,
- >but as I found out C++ allows only exactly one prototype, and by the way:
-
- >Isn't
- >it the job of the compiler to create those prototypes if I create a
- template?
- >
- >Maybe it's a special problem of my compiler: i'm working with the Watcom
- C/C++
- >Compiler V.10.5.
- >
- No, it's not the compiler.
-
- Post a small sample of code that illustrates the problem.
- Show how you define the template classes and its member
- functions.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-